package com.xhwl.centiotdata.service.integrateconfig;

import com.xhwl.common.pojo.cent.device.DeviceProjSupplierCategory;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author： lianghz
 * @Description：
 * @Date 2021/12/17/ 11:39
 */
@Component
public class EESDSupplierConfig extends IntegrationConfig<Integer, List<DeviceProjSupplierCategory>> {

    @Override
    public List<DeviceProjSupplierCategory> getIntegrationConfig(Integer category) {
        return IntegrationConfig.integrationConfigList
                .stream()
                .filter(d ->
                        !StringUtils.isEmpty(d.getProdCategoryId()) && d.getProdCategoryId().equals(category)
                                && !StringUtils.isEmpty(d.getProductId()))
                .collect(Collectors.toList());
    }

}
